package com.flyco.modules.stm.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.flyco.modules.oms.entity.OmsOrderTrace;
import com.flyco.modules.oms.mapper.OmsOrderTraceMapper;
import com.flyco.modules.stm.service.IStmOrderTraceService;
import net.sf.jsqlparser.statement.delete.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @Description: 订单跟踪
 * @Author: flyco
 * @Date: 2020-03-27
 * @Version: V1.0
 */
@DS("store")
@Service
public class StmOrderTraceServiceImpl extends ServiceImpl<OmsOrderTraceMapper, OmsOrderTrace> implements IStmOrderTraceService {

    @Autowired
    private OmsOrderTraceMapper orderTraceMapper;

    @Override
    public void deleteOrderTrace(String traceNo) {

        if (StringUtils.isEmpty(traceNo)) {
            return;
        }
        LambdaQueryWrapper<OmsOrderTrace> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(OmsOrderTrace::getTraceNo, traceNo);
        orderTraceMapper.delete(wrapper);
    }
}
